<?php
include "mysqlConnector.php";
/* 
  include "data.php";
 */
$data = array(
    array( //[0]
        "fecha" => "20-01-2013",
        "monto_banco" => "223.52",
        "monto_ahorro" => "122.52",
        "monto_caja" => "596.52",
        "gastos" => array(
            array(
                "monto" => "102,3",
                "tipo" => "1",
                "observacion" => "carne",
            ),
            array(
                "monto" => "92",
                "tipo" => "2",
                "observacion" => "lo que hay",
            ),
            array(
                "monto" => "32",
                "tipo" => "2",
                "observacion" => "otro gato",
            ),
        ),
        "compras" => array(
            array(
                "monto" => "200",
                "tipo" => "1",
                "observacion" => "mercaderia",
            ),
            array(
                "monto" => "35",
                "tipo" => "1",
                "observacion" => "papas",
            ),
            array(
                "monto" => "12",
                "tipo" => "2",
                "observacion" => "batata",
            ),
        ),
    )
);
//data[0] son los datos del día lunes
$fecha = $data[0]["fecha"];
$monto_bco = $data[0]["monto_banco"];
$monto_ahorro = $data[0]["monto_ahorro"];
$monto_caja = $data[0]["monto_caja"];

function insertarDiario($fecha, $mont_caja ) {
$sql = "INSERT INTO diario (fecha, caja_monto, banco_monto, ahorro_monto) 
    values 
    ('" . $fecha . "', '" . $monto_caja . "', '" . $monto_bco . "', '" . $monto_ahorro . "')";
return $sql;    
}

$conn = new MysqlConnector("localhost","root","", "olmedo");
$conn->connect();
$sql = insertarDiar();
$conn->abmQuery($sql);

$sqlGasto = "INSERT INTO gasto SET 
        tipo = " . $tipo .",
        monto = '" . $monto ."',
        tipo_gasto = " . $tipo_gasto;
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
?>
